package com.xdja.kafka.util;

import org.springframework.util.CollectionUtils;

import java.util.Set;

public class ConnectorUtil {
    /**
     * 获取最早的日期
     */
    public static String getEarliestDate(Set<String> dateSet) {
        if(CollectionUtils.isEmpty(dateSet)) {
            return null;
        }
        String earliestDate = null;
        for(String date : dateSet) {
            if(earliestDate == null) {
                earliestDate = date;
                continue;
            }
            if(date.compareTo(earliestDate) < 0) {
                earliestDate = date;
            }
        }
        return earliestDate;
    }
}
